﻿using System;
using NUnit.Framework;
using Sanjeet.FastCopy.FileCopyLogic.Design3;

namespace Sanjeet.FastCopy.UnitTests
{
    [TestFixture]
    public class AsyncOperationFixture
    {
        #region Setup/Teardown

        [SetUp]
        public void Setup()
        {
            asyncOperation = new AsyncOperation();
            fileTask = new FileTask
                           {
                               Source = @"c:\sanjeet\",
                               Destination = @"c:\sanjeet2\",
                               Overwrite = false,
                               Subfolders = false
                           };
        }

        #endregion

        private IAsyncOperation asyncOperation;
        private IFileTask fileTask;

        [Test]
        [ExpectedException(typeof (ArgumentException))]
        public void CopySourceDoesntExistRaiseException()
        {
            fileTask.Copy();
        }

        [Test]
        [ExpectedException(typeof (ArgumentException))]
        public void FileCopyInvalidSource()
        {
            fileTask.Source = "";
            fileTask.Copy();
        }
    }
}